<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading">线上广宣费用
    <?php if (in_array($action, array('edit')) && in_array($projectData['settleAuditRs'], array(-1,0,3))) {?>
    <a class="btn btn-default col-md-offset-10" onclick="newWindow('新增广宣','<?=printUrl('CityGx','add', array('procId'=>$procId,'projectId'=>$projectId,'isBubao'=>$isBubao))?>',400,500)">新增</a>
    <?php }?>
  </div>
  <table class="table table-bordered">
    <thead>
      <tr>
        <th class="bg-primary text-center">流水号</th>
        <th class="bg-primary text-center">媒体类型</th>
        <th class="bg-primary text-center">媒体地址/名称</th>
        <th class="bg-primary text-center">投放规格</th>
        <th class="bg-primary text-center">发布时间段</th>
        <th class="bg-primary text-center">发布频次</th>
        <th class="bg-primary text-center">预算费用</th>
        <th class="bg-primary text-center">备注</th>
        <th class="bg-primary text-center">预算审核结果</th>
        <?php if (in_array($action, array('edit','audit'))) {?>
        <th class="bg-primary text-center">操作</th>
        <?php } ?>
      </tr>
    </thead>
    <tbody>
    <?php foreach($gxList as $k => $v): ?>
      <tr>
        <td class="text-center"><?php echo $v['id']; ?></td>
        <td class="text-center"><?php echo $v['mediaType1Str'].'<br>'.$v['mediaType2Str']; ?></td>
        <td class="text-center"><?php echo $v['mediaName'] ?></td>
        <td class="text-center"><?php echo $v['mediaSizeStr'] ?></td>
        <td class="text-center"><?php echo $v['startTime'].'至'.$v['endTime'] ?></td>
        <td class="text-center"><?php echo $v['frequency'] ?></td>
        <td class="text-center"><?php echo $v['budgetApply'] ?></td>
        <td class="text-center"><?php echo $v['remarks'] ?></td>
        <td class="text-center"><?php echo $v['budgetAuditStr'] ?></td>
        <?php if (in_array($action, array('edit'))) {?>
        <td class="text-center">
          <!-- 没有预算审核，以结算审核为判断基准 -->
          <?php if (in_array($v['budgetAuditRs'], array(-1,0,3) )) {?>
          <a class="btn btn-default" onclick="newWindow('修改广宣','<?=printUrl('CityGx','add', array('id'=>$v['id']))?>',400,500)" role="button">修改</a>
          <a class="btn btn-default" onclick="ajaxConfirmSubmit('您确定要删除此广宣费用吗？<br>此操作不可撤销','<?=printUrl('CityGx','del')?>',{'id':<?=$v['id']?>})">删除</a>
          <?php } ?>
        </td>
        <?php } ?>
        <?php if (in_array($action, array('audit'))) {?>
        <td class="text-center">
          <?php
          $options = $this->config->item('budgetAuditOptions');
          $extra = ' class="form-control budgetAuditRs" style="width:70px;" money="'.((float)$v['budgetAudit'] ? $v['budgetAudit'] : $v['budgetApply']).'" ';
          if ($v['settleAuditRs'] > -1 || $this->user['userRole'] < $v['budgetAuditRole']) {
            $extra .= " disabled";
          }
          echo form_dropdown('gx['.$v['id'].'][budgetAuditRs]', $options, $v['budgetAuditRs'], $extra);
          ?>
        </td>
        <?php } ?>
      </tr>
    <?php endforeach; ?>
    </tbody>
  </table>
</div>